<extend name="Public/publicHTML"/>
<block name="nav">
    <link rel="stylesheet"  href="__COMMON__/bootstrap/css/bootstrap.min.css"/>
    <script src="__COMMON__/bootstrap/js/bootstrap.min.js"></script>
    <br/>
</block>
<block name="content">
    <section class="content">
    <div class="container-fluid">
      <div class="panel panel-default">
        <div class="panel-heading">
          <h3 class="panel-title"><i class="fa fa-list"></i>运费模板列表</h3>
        </div>
        <div class="panel-body">
          <div class="navbar navbar-default">
              <form action="{:U('lists')}" id="search" class="navbar-form form-inline" method="get">
                <div class="form-group">
                  <label class="control-label" for="input-order-id">关键词</label>
                  <div class="input-group">
                    <input type="text" name="{$freightModel::$expressTitle_d}" value="{$_GET[$freightModel::$expressTitle_d]}" placeholder="搜索词" id="input-order-id" class="form-control">
                  </div>
                </div>                  
                <!--排序规则-->
                <button type="submit" id="button-filter search-order"  onclick="javascript:$('#search').submit();" class="btn btn-primary"><i class="fa fa-search"></i> 筛选</button>
                <button type="button" onclick="location.href='{:U('addTemplateHtml')}'" class="btn btn-primary pull-right"><i class="fa fa-plus"></i>添加运费模板</button>
              </form>
          </div>
                    <div id="ajax_return">
                        <div class="table-responsive">
                            <table class="table table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th class="sorting text-left">ID</th>
                                    <th class="sorting text-left">模板名称</th>
                                    <th class="sorting text-left">仓库</th>
                                    <th class="sorting text-left">几个小时内发货</th>
                                    <th class="sorting text-left">是否包邮</th>
                                    <th class="sorting text-left">计价方式</th>
                                    <th class="sorting text-left">是否指定条件包邮</th>
                                    <th class="sorting text-left">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                	<if condition="!empty($data['data'])">
		                                <foreach name="data['data']" item="row">
		                                    <tr>
		                                        <td class="text-left">{$row[$freightModel::$id_d]}</td>
		                                        <td class="text-left">{$row[$freightModel::$expressTitle_d]}</td>
		                                        <td class="text-left">{$row[$sendModel::$stockName_d]}</td>
		                                        <td class="text-left">{$row[$freightModel::$sendTime_d]}</td>
		                                        <td class="text-left"><if condition="$row[$freightModel::$isFree_shipping_d] eq 1">自定义运费<else/>卖家包邮</if></td>
		                                        <td class="text-left">
			                                        <php> $stat = $row[$freightModel::$valuationMethod_d];</php>
			                                        <switch name="stat">
			                                        	<case value="1">按件</case>
			                                        	<case value="2">按重量</case>
			                                        	<case value="3">按体积</case>
			                                        </switch>
		                                        </td>
		                                        <td class="text-left shelves-one">
		                                            <php> if ($row[$freightModel::$isSelect_condition_d] == 1) {</php>
		                                               <img src="__COMMON__/img/yes.png"  onclick="" class="cursor" data-flag="true"/>
		                                            <php>} else {</php>
		                                                <img src="__COMMON__/img/cancel.png" onclick=""  class="cursor"  data-flag="false"/>
	                                            	<php>}</php>
	                                            </td>
	                                        <td class="text-left">
											<a href="{:U('modifyHtml', array($freightModel::$id_d => $row[$freightModel::$id_d]))}" class="btn btn-primary">编辑</a> 
												<if condition="$row[$freightModel::$isSelect_condition_d] == 1">
													<a href="{:U('specifyCondition', array('id' => $row[$freightModel::$id_d]))}" class="btn btn-primary">包邮设置</a> 
												</if>
                                            <input type="button" class="btn btn-danger del_btn confirm_btn" data-id="{$row.id}" data-toggle="modal" data-target="#myModal" value="删除"/>
                                        	</td>
		                                    </tr>
		                                </foreach>
	                                </if>
                                </tbody>
                            </table>
                            <div class="page">{$data['page']}</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
  <script src="__COMMON__/js/alert.js"></script>
   <script src="__JS__/express/express.js"></script>
</block>